<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script>
    var t = async_test('Makes sure that preloader preloaded resources are delaying onload after they are discovered');
</script>
<script src="../resources/slow-script.pl?delay=200"></script>
<script>
    window.addEventListener("load", t.step_func(function() {
        assert_equals(performance.getEntriesByType("resource").length, 4);
        t.done();
    }));
</script>
<script>
    document.write("<!--");
    var img = new Image();
    img.src = "http://127.0.0.1:8000/resources/slow-image.php?name=square.png&mimeType=image/png&sleep=400";
</script>
<img src="http://127.0.0.1:8000/resources/slow-image.php?name=square.png&mimeType=image/png&sleep=400">
